// 插件：数据持久化存储
export default store => {
	if (localStorage.state) {
		// JSON.parse：字符串转对象
		store.replaceState(JSON.parse(localStorage.state));
	}
	store.subscribe((mutation, state) => {
		// JSON.stringify：对象转字符串
		localStorage.state = JSON.stringify(state);
	})
}
